/**
 * Created by alan on 2017/5/5.
 * 模型参数
 */
Ext.define('Admin.view.sys.modelParam',{
  extend:'Ext.container.Container',
  xtype:'modelParam',
  //起别名
  alias:'modelParam',
  controller: 'modelParamController',
  userCLs:'big-100 small-100',
  layout:'fit',
  items:{
    xtype:'panel',
    layout:'anchor',
    cls:'dashboard-main-chart shadow',
    width:'100%',
    minHeight:760,
    margin:7,
    bodyPadding:7,
    items:[
      {
        xtype:'grid',
        title:'模型参数',
        height:'100%',
        border:true,
        hidden:true,
        margin:'0 0 10 0',
        bind:{
          store:'dict'
        },
        reference: 'historyGrid',//添加“reference”配置到表格并用lookupReference方法获取表格组件
        stripeRows:true,//斑马纹效果
        loadMask:true,//loading效果
        multiSelect:false//允许用户在列表中同时选择多个
      },{
          xtype:'panel',
          title:'模型参数',
          height:'100%',
          border:true,
          margin:'0 0 10 0',
      },{
        tbar: [{
          xtype: "textfield",
          maxWidth: 220,
          fieldLabel: "参数名称",
          labelWidth: 80,
          reference: "paraNm"
        },
        {
          xtype: "button",
          text: "查询",
          iconCls: 'x-fa  fa-file-o',
          handler: 'check',
          margin:'0 10 0 10',
          // style: 'background-color:#108ee9; border-radius:4px;-webkit-border-radius: 4px;',
          style: 'border-radius:4px;-webkit-border-radius: 4px;'
        }],
        margin:'0 0 10 0'
      },{
        region: 'center',
        itemId: 'card',
        width: '100%',
        layout: 'card',
        items:[{
          extend:'Ext.tab.Panel',
          // xtype;'riverBaseInfoChild',
          //xtype: 'layout-cardtabs',

          border:true,
          style: 'background-color:#dfe8f6; ',
          items:{
            // title: '测站名称',
            xtype:'grid',
            reference: 'modelParamGrid',
            columns: [
              {header: '模型编码', dataIndex: 'modelId',/** editor: 'textfield' ,*/align:'center',width:'20%'},
              {header: '参数名称', dataIndex: 'paraNm',/** editor: 'textfield' ,*/align:'center',width:'20%'},
              {header: '参数值', dataIndex: 'paraValue', /** editor: 'textfield' ,*/align:'center',width:'20%'},
              {header: '参数描述', dataIndex: 'paraComent', /** editor: 'textfield' ,*/align:'center',width:'20%'},
              {header: '操作', dataIndex: 'operate', /** editor: 'textfield' ,*/align:'center',xtype : 'actioncolumn',width:'19.8%',
                items:[
                  {xtype:'button',
                   text:'修改',
                   iconCls: "x-fa fa-edit",
                   style: 'border-radius:4px;-webkit-border-radius: 4px;',
                   handler: 'update'
                  },{xtype:'button',
                   text:'删除',
                   iconCls: "x-fa fa-trash",
                   style: 'border-radius:4px;-webkit-border-radius: 4px;',
                   handler: 'delete'
                  }]
            }

           ],
           store: {
             fields : ['modelId','paraNm','paraValue','paraComent'],
             data : [
                    {modelId:'mp00001',paraNm:'计算系数',paraValue:'05',paraComent:'2017-05-06'},
                    {modelId:'mp00002',paraNm:'调度系数',paraValue:'0.7',paraComent:'2017-05-06'}
             ]
           },
           stripeRows: true,
           columnLines: true,
           plugins: {
             ptype: 'cellediting',
             clicksToEdit: 1
           }
         }
        }]
      }
    ]
  }
})
